package com.gali.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Auther: gali
 * @Date: 2022/7/11-07-11-14:29
 * @Description:
 */
@Configuration
public class MySelfRule
{
    @Bean
    public IRule myRule()
    {
//        return new RandomRule();// Ribbon默认是轮询，我自定义为随机
//        return new RoundRobinRule();// Ribbon默认是轮询，我自定义为随机
        return new MyRuleRibbon();// 我自定义为每台机器5次
    }
}

